package Tasks;

import java.util.LinkedList;
import java.util.List;

import ru.ys.jsolver.interfaces.ITask;

public class Crossword2 implements ITask{
	private Integer[] row00 = {9, 10, 10};	
	private Integer[] row01 = {8, 14, 9}; 
	private Integer[] row02 = {7, 16, 8}; 
	private Integer[] row03 = {6, 18, 7}; 
	private Integer[] row04 = {5, 17, 2, 7};
	
	private Integer[] row05 = {4, 2, 14, 1, 7}; 
	private Integer[] row06 = {3, 2, 16, 6}; 
	private Integer[] row07 = {3, 2, 12, 2, 5}; 
	private Integer[] row08 = {2, 3, 11, 2, 4}; 
	private Integer[] row09 = {2, 5, 10, 1, 1, 1, 2, 3};
	
	private Integer[] row10 = {2, 1, 13, 1, 1, 1, 2, 3}; 
	private Integer[] row11 = {1, 1, 2, 9, 2, 1, 2, 1, 2}; 
	private Integer[] row12 = {1, 2, 2, 1, 8, 1, 1, 1, 2, 1}; 
	private Integer[] row13 = {1, 1, 8, 1, 1, 2, 2}; 
	private Integer[] row14 = {2, 1, 7, 1, 2, 2, 2};
	
	private Integer[] row15 = {1,2,7,2,1,1,3,1}; 
	private Integer[] row16 = {1,1,2,6,3,1,1,1,2,1}; 
	private Integer[] row17 = {5,1,6,3,1,1,1,3}; 
	private Integer[] row18 = {1,1,9,1,1,1}; 
	private Integer[] row19 = {2,1,8,1,1,1,5};
	
	private Integer[] row20 = {2,4,9,2,1,5}; 
	private Integer[] row21 = {2,1,9,3,5}; 
	private Integer[] row22 = {2,2,8,2,6}; 
	private Integer[] row23 = {2,1,2,8,2,7}; 
	private Integer[] row24 = {2,2,3,10,8};
	
	private Integer[] row25 = {2,5,8,9}; 
	private Integer[] row26 = {3,1,7,10}; 
	private Integer[] row27 = {7,2,3,12}; 
	private Integer[] row28 = {7,1,3,17}; 
	private Integer[] row29 = {8,4,19}; 
		
		
		
	private Integer[] col00 = {13,11};
	private Integer[] col01 = {11,4,11};
	private Integer[] col02 = {8,3,1,4};
	private Integer[] col03 = {6,4,4,3,3};
	private Integer[] col04 = {5,3,1,3,2,3};
	
	private Integer[] col05 = {4,4,1,2,1,1,3};
	private Integer[] col06 = {3,2,2,2,1,1,3};
	private Integer[] col07 = {2,2,2,1,3,1,1};
	private Integer[] col08 = {1,2,1,2,4};
	private Integer[] col09 = {3,1,4,1,3};
	
	private Integer[] col10 = {5,1,2,1};
	private Integer[] col11 = {15,1,1};
	private Integer[] col12 = {18,2};
	private Integer[] col13 = {19,1};
	private Integer[] col14 = {22,2};
	
	private Integer[] col15 = {25,1};
	private Integer[] col16 = {28,1};
	private Integer[] col17 = {27,1};
	private Integer[] col18 = {14,9,2};
	private Integer[] col19 = {12,11,2};
	
	private Integer[] col20 = {10,12,2};
	private Integer[] col21 = {9,16,2};
	private Integer[] col22 = {7,3,7,2};
	private Integer[] col23 = {6,5,2,3};
	private Integer[] col24 = {2,1,6,2,3};
	
	private Integer[] col25 = {1,2,1,10,4};
	private Integer[] col26 = {2,4,3,3,5};
	private Integer[] col27 = {3,2,3,1,6};
	private Integer[] col28 = {6,2,8,7};
	private Integer[] col29 = {7,2,2,8};
	
	private Integer[] col30 = {8,3,2,11};
	private Integer[] col31 = {9,2,2,11};
	private Integer[] col32 = {11,2,1,11};
	private Integer[] col33 = {12,4,11};
	private Integer[] col34 = {13,11};
	
	
	private List<Integer> generateList(Integer[] mas) {
		List<Integer> result = new LinkedList<Integer>();
		for (int i = 0; i < mas.length; i++) {
			result.add(mas[i]);
		}
		return result;
	}
	
	@Override
	public List<Integer> getCollumn(int i) {
		switch(i) {
		case 0: return generateList(col00);
		case 1: return generateList(col01);
		case 2: return generateList(col02);
		case 3: return generateList(col03);
		case 4: return generateList(col04);		
		case 5: return generateList(col05);		
		case 6: return generateList(col06);
		case 7: return generateList(col07);
		case 8: return generateList(col08);
		case 9: return generateList(col09);
		
		case 10: return generateList(col10);
		case 11: return generateList(col11);
		case 12: return generateList(col12);
		case 13: return generateList(col13);
		case 14: return generateList(col14);		
		case 15: return generateList(col15);		
		case 16: return generateList(col16);
		case 17: return generateList(col17);
		case 18: return generateList(col18);
		case 19: return generateList(col19);
		

		case 20: return generateList(col20);
		case 21: return generateList(col21);
		case 22: return generateList(col22);
		case 23: return generateList(col23);
		case 24: return generateList(col24);		
		case 25: return generateList(col25);		
		case 26: return generateList(col26);
		case 27: return generateList(col27);
		case 28: return generateList(col28);
		case 29: return generateList(col29);
		
		case 30: return generateList(col30);
		case 31: return generateList(col31);
		case 32: return generateList(col32);
		case 33: return generateList(col33);
		case 34: return generateList(col34);		
		}
		return null;
	}

	@Override
	public int getHeight() {		
		return 30;
	}

	@Override
	public List<Integer> getRow(int i) {		
		switch(i) {
		case 00: return generateList(row00);
		case 01: return generateList(row01);
		case 02: return generateList(row02);
		case 03: return generateList(row03);
		case 04: return generateList(row04);
		case 05: return generateList(row05);
		case 06: return generateList(row06);
		case 07: return generateList(row07);
		case 8: return generateList(row08);
		case 9: return generateList(row09);
		
		case 10: return generateList(row10);
		case 11: return generateList(row11);
		case 12: return generateList(row12);
		case 13: return generateList(row13);
		case 14: return generateList(row14);
		case 15: return generateList(row15);
		case 16: return generateList(row16);
		case 17: return generateList(row17);
		case 18: return generateList(row18);
		case 19: return generateList(row19);
		
		case 20: return generateList(row20);
		case 21: return generateList(row21);
		case 22: return generateList(row22);
		case 23: return generateList(row23);
		case 24: return generateList(row24);
		case 25: return generateList(row25);
		case 26: return generateList(row26);
		case 27: return generateList(row27);
		case 28: return generateList(row28);
		case 29: return generateList(row29);
			
		
		}
		return null;
	}

	@Override
	public int getWidth() {
		return 35;
	}

}
